home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / n_b_v203.zip / MID$.DMO < prev    next >
Text File  |  1996-07-04  |  2KB  |  52 lines

  1. $if 0
  2.     ┌──────────────────────────╖                        PowerBASIC v3.20
  3.  ┌──┤          DASoft          ╟──────────────────────┬──────────────────╖
  4.  │  ├──────────────────────────╢    Copyright 1995    │ DATE: 1995-10-01 ╟─╖
  5.  │  │ FILE NAME   MID$    .DMO ║          by          ╘════════════════─ ║ ║
  6.  │  │                          ║  Don Schullian, Jr.                     ║ ║
  7.  │  ╘══════════════════════════╝                                         ║ ║
  8.  │ A license is hereby granted to the holder to use this source code in  ║ ║
  9.  │ any program, commercial or otherwise,  without receiving the express  ║ ║
  10.  │ permission of the copyright holder and without paying any royalties,  ║ ║
  11.  │ as long as this code is not distributed in any compilable format.     ║ ║
  12.  │  IE: source code files, PowerBASIC Unit files, and printed listings   ║ ║
  13.  ╘═╤═════════════════════════════════════════════════════════════════════╝ ║
  14.    │                ....................................                   ║
  15.    ╘═══════════════════════════════════════════════════════════════════════╝
  16. $endif
  17.  
  18. $INCLUDE "DAS-NB01.INC"
  19. COLOR 7,0
  20. CLS
  21.  
  22. ? "┌───────────────────────────────────────────────────────────
  23. ? "│ fMID$ ( V$, Start%, Finish% )
  24. ? "├──────────────────────────────────────────────────────────────
  25. ? "│ Unlike PowerBASIC's MID$ this function works on a from/to
  26. ? "│ concept instead of from/for
  27. ? "│ Instead of MID$( V$, Start%, Finish%-Start%+1 )
  28. ? "│ you use    fMID$( V$, Start%, Finish% )
  29. ? "│                                          and save a little typing!
  30. ? "│ NOTE: press F9 a few times
  31. ? "└─────────────────────────────────────────────────────────────────────
  32.  
  33. V$ = "This is a test."
  34. Start% = 11 : Finish% = 14
  35. PRINT V$
  36. PRINT
  37.  
  38. MTIMER
  39.   D$ = fMID$( V$, Start%, Finish% )
  40. DASoft = MTIMER
  41. PRINT D$
  42. PRINT USING "ELAPSED TIME: DASoft =###m/sec"; DASoft
  43. PRINT
  44.  
  45. MTIMER
  46.   P$ = MID$( V$, Start%, ( Finish% - Start% + 1 ) )
  47. PBasic = MTIMER
  48. PRINT P$
  49. PRINT USING "ELAPSED TIME: PBasic =###m/sec"; PBasic
  50.  
  51.  
  52.